<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="DNS," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="DNS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;全称domain name server。域名服务器，用来解析域名的。  &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;域名标准写法：www.qq.com. &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#1">
<meta name="keywords" content="DNS">
<meta property="og:type" content="article">
<meta property="og:title" content="DNS、iredmaill 邮件服务">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/Dns、Iredmaill/1. dns、iredmail邮件服务/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="DNS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;全称domain name server。域名服务器，用来解析域名的。  &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;域名标准写法：www.qq.com. &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#1">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://github.com/hcldirgit/image/blob/master/dns%E3%80%81iredmaill%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1/01.png?raw=true">
<meta property="og:image" content="http://note.youdao.com/yws/public/resource/f413494d6e99fd7f2fc23e25ee770484/xmlnote/73083A746F144E6E865BCFAB35CBF944/7728">
<meta property="og:updated_time" content="2017-09-01T08:46:11.390Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="DNS、iredmaill 邮件服务">
<meta name="twitter:description" content="DNS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;全称domain name server。域名服务器，用来解析域名的。  &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;域名标准写法：www.qq.com. &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#1">
<meta name="twitter:image" content="https://github.com/hcldirgit/image/blob/master/dns%E3%80%81iredmaill%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1/01.png?raw=true">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/Dns、Iredmaill/1. dns、iredmail邮件服务/"/>





  <title>DNS、iredmaill 邮件服务 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/Dns、Iredmaill/1. dns、iredmail邮件服务/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">DNS、iredmaill 邮件服务</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T02:00:30+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="DNS"><a href="#DNS" class="headerlink" title="DNS"></a>DNS</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;全称domain name server。域名服务器，用来解析域名的。</p>
<p><img src="https://github.com/hcldirgit/image/blob/master/dns%E3%80%81iredmaill%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1/01.png?raw=true" alt="images"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;域名标准写法：www.qq.com.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DNS是如何实现解析域名的：客户端先查找/etc/hosts里是否有对应域名的ip，没有的话查找dns服务器（在/etc/resolv.conf下配置的），首先查找缓存，缓存没有，找.根名称服务器DNS，根名称服务器说没有，但我知道.com，又找.com顶级名称服务器，从.com找到microsoft.com。最终找到example.microsoft.com。找的过程都是找的dns服务器。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># yum install -y bind</span></div><div class="line">[root@linux ~]<span class="comment"># vi /etc/named.conf          //以下是用到的配置信息，其它暂且不理会</span></div><div class="line">options &#123;</div><div class="line">        listen-on port 53 &#123; 127.0.0.1; &#125;;                //监听端口53，监听53端口的ip是谁</div><div class="line">        listen-on-v6 port 53 &#123; ::1; &#125;;                     //ipv6</div><div class="line">        directory       <span class="string">"/var/named"</span>;                    //子配置文件所对应的目录</div><div class="line">logging &#123;</div><div class="line">        channel default_debug &#123;</div><div class="line">                file <span class="string">"data/named.run"</span>;                    //日志。路径/var/named/data/named.run</div><div class="line">                severity dynamic;</div><div class="line">        &#125;;</div><div class="line">&#125;;</div><div class="line">zone <span class="string">"."</span> IN &#123;                                                    //.就是根域</div><div class="line">        <span class="built_in">type</span> hint;                                                //<span class="built_in">type</span>有三种，master主，slave从，hint根域的hint</div><div class="line">        file <span class="string">"named.ca"</span>;                                      //根域对应的文件。文件在/var/named/下</div><div class="line">&#125;;</div><div class="line">[root@linux ~]<span class="comment"># vim /var/named/named.ca        //每一个域对应一个机器。</span></div><div class="line">[root@linux ~]<span class="comment"># cat /var/named/named.localhost</span></div><div class="line"><span class="variable">$TTL</span> 1D                                                                          //1D就是1天生存周期</div><div class="line">@       IN SOA  @ rname.invalid. (                                 //SOA指的是解析记录。如A、CNAME等</div><div class="line">                                        0       ; serial                 //序列号</div><div class="line">                                        1D      ; refresh            //从每隔一段时间刷一次和主的数据是否有更新</div><div class="line">                                        1H      ; retry               //发现和主不通了，再过多长时间去试一下。</div><div class="line">                                        1W      ; expire            //过期时间。缓存时间，一周</div><div class="line">                                        3H )    ; minimum       //和上面的TTL有关，上面没有定义，以此项为准 </div><div class="line">          NS          @</div><div class="line">          A             127.0.0.1</div><div class="line">          AAAA      ::1                                   //ipv6</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;其中第二行的@符号指的是/etc/named.rfc1912.zones中定义的zone引号里面的内容。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># /etc/init.d/named start</span></div><div class="line">[root@linux ~]<span class="comment"># dig @127.0.0.1 localhost</span></div><div class="line">[root@linux ~]<span class="comment"># dig @127.0.0.1 localhost.localdomain</span></div><div class="line">[root@linux ~]<span class="comment"># dig @127.0.0.1 -x 127.0.0.1     //测试反解析          //反解析</span></div></pre></td></tr></table></figure>
<h3 id="1-正向解析"><a href="#1-正向解析" class="headerlink" title="1.正向解析"></a>1.正向解析</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># vim /etc/named.conf                  //在内容的最后面增加以下内容</span></div><div class="line">zone <span class="string">"123.com"</span> IN &#123;</div><div class="line">        <span class="built_in">type</span> master;</div><div class="line">        file <span class="string">"123.com.zone"</span>;</div><div class="line">&#125;;</div><div class="line">[root@linux ~]<span class="comment"># named-checkconf                      //检测是否有错</span></div><div class="line">[root@linux ~]<span class="comment"># vim /var/named/123.com.zone</span></div><div class="line"><span class="variable">$TTL</span> 1D</div><div class="line">@        IN SOA  @ admin.123.com. (</div><div class="line">                                        20161025       ; serial</div><div class="line">                                        1D      ; refresh</div><div class="line">                                        1H      ; retry</div><div class="line">                                        1W      ; expire</div><div class="line">                                        3H )    ; minimum</div><div class="line">           IN  NS      ns.123.com.</div><div class="line">           IN  MX  5   mail.123.com.</div><div class="line">mail    IN  A       192.168.1.20</div><div class="line">ns       IN  A       192.168.1.70                       //对外服务应写公网ip</div><div class="line">www   IN  A       11.11.11.11</div><div class="line">bbs     IN  CNAME   www</div><div class="line">[root@linux ~]<span class="comment"># named-checkzone "123.com" /var/named/123.com.zone</span></div><div class="line">zone 123.com/IN: loaded serial 20161025</div><div class="line">OK</div><div class="line">[root@linux ~]<span class="comment"># vim /etc/named.conf</span></div><div class="line">options &#123;</div><div class="line">        listen-on port 53 &#123; 127.0.0.1;192.168.1.70; &#125;;</div><div class="line">[root@linux ~]<span class="comment"># /etc/init.d/named restart</span></div><div class="line">[root@linux ~]<span class="comment"># dig @192.168.1.70 www.123.com</span></div></pre></td></tr></table></figure>
<h3 id="2-反向解析"><a href="#2-反向解析" class="headerlink" title="2.反向解析"></a>2.反向解析</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;想做邮件服务器，最好加下反解析。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># vim /etc/named.conf          //添加以下内容</span></div><div class="line">zone <span class="string">"1.168.192.in-addr.arpa"</span> IN &#123;</div><div class="line">        <span class="built_in">type</span> master;</div><div class="line">        file <span class="string">"1.168.192.zone"</span>;</div><div class="line">&#125;;</div><div class="line">[root@linux ~]<span class="comment"># vim /var/named/1.168.192.zone</span></div><div class="line"><span class="variable">$TTL</span> 1D</div><div class="line">@        IN SOA  @ admin.123.com. (</div><div class="line">                                        20161025       ; serial</div><div class="line">                                        1D      ; refresh</div><div class="line">                                        1H      ; retry</div><div class="line">                                        1W      ; expire</div><div class="line">                                        3H )    ; minimum</div><div class="line">           IN  NS      ns.123.com.</div><div class="line">160     IN  PTR     ns.123.com.</div><div class="line">20       IN  PTR     mail.123.com.</div><div class="line">[root@linux ~]<span class="comment"># named-checkconf</span></div><div class="line">[root@linux ~]<span class="comment"># /etc/init.d/named restart</span></div><div class="line">[root@linux ~]<span class="comment"># dig @192.168.1.70 -x 192.168.1.20</span></div></pre></td></tr></table></figure>
<h3 id="从DNS服务器"><a href="#从DNS服务器" class="headerlink" title="从DNS服务器"></a>从DNS服务器</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># yum install -y bind             </span></div><div class="line">[root@linux ~]<span class="comment"># vim /etc/named.conf               //注释//这两行将会监听服务器上所有端口</span></div><div class="line">options &#123;</div><div class="line">//        listen-on port 53 &#123; 127.0.0.1;192.168.1.70; &#125;;</div><div class="line">//        listen-on-v6 port 53 &#123; ::1; &#125;;</div><div class="line">[root@linux ~]<span class="comment"># vim /etc/named.conf              //在文件下面添加以下信息</span></div><div class="line">zone <span class="string">"123.com"</span> IN &#123;</div><div class="line">        <span class="built_in">type</span> slave;</div><div class="line">        file <span class="string">"slaves/123.com.zone"</span>;</div><div class="line">     masters &#123; 192.168.11.160; &#125;;                      //注意大括号前后面有空格。</div><div class="line">&#125;;</div><div class="line">[root@linux ~]<span class="comment"># /etc/init.d/named start</span></div><div class="line">[root@linux ~]<span class="comment"># ls /var/named/slave     //有没有生成这两个文件 </span></div><div class="line">11.168.192.zone   123.com.zone</div><div class="line">[root@linux ~]<span class="comment"># cat /var/named/slaves/123.com.zone         //查看和主上是否一致</span></div><div class="line">[root@linux ~]<span class="comment"># dig @192.168.1.20 www.123.com               //检测解析</span></div><div class="line">[root@linux ~]<span class="comment"># dig @192.168.1.20 -x 192.168.1.70</span></div><div class="line">[root@linux ~]<span class="comment"># vim /var/named/123.com.zone   //增加一个域名记录</span></div><div class="line">aming    IN    A          111.111.111.111</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;主上有更改，从上立马生效，需要在主配置文件中添加两条notify yes;also-notify { 192.168.1.20; };</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># named-checkconf</span></div><div class="line">[root@linux ~]<span class="comment"># /etc/init.d/named restart</span></div></pre></td></tr></table></figure>
<h2 id="iredmaill"><a href="#iredmaill" class="headerlink" title="iredmaill"></a>iredmaill</h2><h3 id="iredmail安装"><a href="#iredmail安装" class="headerlink" title="iredmail安装"></a>iredmail安装</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iRedMail 是一个基于 Linux/BSD 系统的零成本、功能完备、成熟的邮件服务器解决方案。<a href="www.iredmail.com">官网</a></p>
<h4 id="iRedmail包含的套件："><a href="#iRedmail包含的套件：" class="headerlink" title="iRedmail包含的套件："></a>iRedmail包含的套件：</h4><ul>
<li>postfix发邮件的</li>
<li>dovecot收邮件的</li>
<li>apache网页web访问，数据存放mysql或者openldap里面。</li>
<li>policyd拒绝黑名单</li>
<li>amavisd杀毒、扫描垃圾邮件</li>
<li>roundcube在web页面访问邮箱收发邮件的套件。即webmail</li>
<li>awstat分析日志</li>
<li>fail2ban防止暴力破解</li>
<li>iRedAdmin管理邮件，账户增加、删除、修改</li>
</ul>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;需有域名和服务器，服务器配置内存不低于1G</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;首先修改域名的MX记录指向自定义的比如mail.lishiming.net上 ,mail.lishiming.net需A记录指向购买的公网服务器ip上。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">[root@linux ~]<span class="comment"># hostname mail.lishiming.net</span></div><div class="line">[root@linux ~]<span class="comment"># vim /etc/hosts</span></div><div class="line">127.0.0.1   mail.lishiming.net   localhost</div><div class="line">[root@linux ~]<span class="comment"># wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.5-1.tar.bz2</span></div><div class="line">[root@linux ~]<span class="comment"># cd iRedMail-0.9.0</span></div><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># cd pkgs/</span></div><div class="line">[root@linux pkgs]<span class="comment"># vim get_all.sh           //里面的iredmail.org修改一下</span></div><div class="line">[root@linux pkgs]<span class="comment"># sed -i 's/iredmail.org/106.187.51.47/g' get_all.sh     //ip是日本的代理服务器</span></div><div class="line">[root@linux pkgs]<span class="comment"># cd ..</span></div><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># sh iRedMail.sh</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;将会出来类似于图片界面，yes–Next–按tab选择Apache（按空格键选项前会出来*号说明选中）–选择MySQL–设置mysql密码–设置域（填写域名）–设置管理员的密码–Next。输入y–是否启用iptables选择n–移动my.cnf选择y。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># for s in httpd iredapd amavisd clamd postfix dovecot cbpolicyd spamassassin clamd.amavisd saslauthd fail2ban; do /etc/init.d/$s restart; done</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;启动以上这些服务。</p>
<h3 id="iredmail使用"><a href="#iredmail使用" class="headerlink" title="iredmail使用"></a>iredmail使用</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;唯有dovecot启动是失败，错误提示ipv6的ip失败，这时需编辑配置文件。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># vim /etc/dovecot/dovecot.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;找到：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">listen = *  [::]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改为：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">listen = *</div><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># /etc/init.d/dovecot restart</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这时浏览器访问：<a href="https://mail.lishiming.net/iredadmin" target="_blank" rel="external">https://mail.lishiming.net/iredadmin</a>        //提示：您的连接不是私密连接，这时点击下面的“高级”–继续访问。Add–User  增加一个邮箱用户。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;foxmail新建一个账号，输入新建的邮箱用户名和密码。</p>
<p><img src="http://note.youdao.com/yws/public/resource/f413494d6e99fd7f2fc23e25ee770484/xmlnote/73083A746F144E6E865BCFAB35CBF944/7728" alt="images"></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;接下来，进行发收邮件的测试。这时收件时速度有些慢，更改以下文件：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># vim /etc/policyd/cluebringer.conf           </span></div><div class="line">注释<span class="comment">#Greylisting               //灰名单</span></div><div class="line">[root@linux iRedMail-0.9.0]<span class="comment"># /etc/init.d/postfix restart; /etc/init.d/dovecot restart;/etc/init.d/cbpolicyd restart</span></div></pre></td></tr></table></figure>
<h3 id="iredmail增加域"><a href="#iredmail增加域" class="headerlink" title="iredmail增加域"></a>iredmail增加域</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;5d6d.com   MX   mail.lishiming.net.             //解析</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;浏览器访问：<a href="https://mail.lishiming.net/iredadmin" target="_blank" rel="external">https://mail.lishiming.net/iredadmin</a>        //Add–Domain  增加一个域。5d6d.com</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;之后Add增加一个邮箱用户名lishiming@5d6d.com</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在foxmail上右上角–账号管理–增加账号</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;测试收发邮件。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/DNS/" rel="tag"># DNS</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/Ansible/1. Ansible 安装与配置/" rel="next" title="Ansible 安装与配置">
                <i class="fa fa-chevron-left"></i> Ansible 安装与配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/Dns、Iredmaill/10. DNS服务器(四)：DNS视图及bind中rndc的使用/" rel="prev" title="DNS服务器(四)：DNS视图及bind中rndc的使用">
                DNS服务器(四)：DNS视图及bind中rndc的使用 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#DNS"><span class="nav-number">1.</span> <span class="nav-text">DNS</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-正向解析"><span class="nav-number">1.1.</span> <span class="nav-text">1.正向解析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-反向解析"><span class="nav-number">1.2.</span> <span class="nav-text">2.反向解析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#从DNS服务器"><span class="nav-number">1.3.</span> <span class="nav-text">从DNS服务器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#iredmaill"><span class="nav-number">2.</span> <span class="nav-text">iredmaill</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#iredmail安装"><span class="nav-number">2.1.</span> <span class="nav-text">iredmail安装</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#iRedmail包含的套件："><span class="nav-number">2.1.1.</span> <span class="nav-text">iRedmail包含的套件：</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#iredmail使用"><span class="nav-number">2.2.</span> <span class="nav-text">iredmail使用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#iredmail增加域"><span class="nav-number">2.3.</span> <span class="nav-text">iredmail增加域</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
